package com.ruoyi.individual.enumeration;

/**
 * <p>Title: StateEnum</p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2023</p>
 * <p>author: YaoHui</p>
 * <p>version: 1.0</p>
 */
public enum StateEnum {
    In("0", "在馆"),
    Select("1", "选中"),
    Repair("2", "维修"),
    Lend("3", "借出"),
    BeBehind("4", "拖欠"),
    Lose("5", "丢失");

    private final String code;
    private final String name;

    StateEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    // 提供一个静态方法来根据代码获取对应的枚举状态
    public static StateEnum getStateByCode(String code) {
        for (StateEnum state : StateEnum.values()) {
            if (state.code.equals(code)) {
                return state;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }
    public String getName(){
        return name;
    }
}
